package com.my.main;

import com.my.utils.ApplicationContextutils;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;

public class redisText {

      @Test
        public void text(){

        ApplicationContext applicationContext = ApplicationContextutils.getApplicationContext();
        RedisTemplate redisTemplate = applicationContext.getBean(RedisTemplate.class);
        redisTemplate.opsForValue().set("name","tom");
        String name = (String) redisTemplate.opsForValue().get("name");
        System.out.println(name);

//        String aa1 = redisTemplate.opsForValue().get("aa");
      }

}
